package com.hua.designpattern.j2eepattern.mvc;

public class UserController {
	private UserModel userModel;
	private UserView userView;

	public UserController(UserModel userModel, UserView userView) {
		super();
		this.userModel = userModel;
		this.userView = userView;
	}

	public int getId() {
		return userModel.getId();
	}

	public void setId(int id) {
		userModel.setId(id);
	}

	public boolean isMale() {
		return userModel.isMale();
	}

	public void setMale(boolean isMale) {
		userModel.setMale(isMale);
	}

	public String getUserName() {
		return userModel.getUserName();
	}

	public void setUserName(String userName) {
		userModel.setUserName(userName);
	}

	public String getPassWord() {
		return userModel.getPassWord();
	}

	public void setPassWord(String passWord) {
		userModel.setPassWord(passWord);
	}

	public void showView() {
		userView.displayUserDetail(userModel.getId(), userModel.isMale(), userModel.getUserName());
	}

}
